using Microsoft.Extensions.Logging;

namespace ConsoleGenericHostDemo;

public interface IOrderService
{
    void AutoCancel();
}

public class OrderService : IOrderService
{
    private readonly ILogger<OrderService> _logger;

    public OrderService(ILogger<OrderService> logger)
    {
        _logger = logger;
    }

    public void AutoCancel()
    {
        _logger.LogInformation("Start AutoCancel");
        Console.WriteLine("Order canceled!");
        _logger.LogInformation("Finished AutoCancel");
    }
}
